<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对象的扩展</title>
</head>
<body>
<script type="text/javascript">
    const name = 'tom',age = 18;
    function sayName(){
        console.log(this.name);
        console.log(this);
    }
    let obj = {
        name,
        age,
        sayName
    }
    obj.sayName();
</script>
</body>
</html>